//
//  BranPage_CCell.swift
//  MikerShop
//
//  Created by eme on 2017/1/5.
//  Copyright © 2017年 eme. All rights reserved.
//

/*
 owner:cy
 update:2017年01月05日14:03:46
 info: 品牌详情 横屏显示 商品区域
 VC :  BranPage_Vc
 */
import UIKit
import Kingfisher
import RxSwift
import RickonCore

class BranPage_CCell: UICollectionViewCell {
    
    static let interitemSpacing:CGFloat = 0
    static let lineSpacing:CGFloat = 0
    static let cellTop:CGFloat = 0
    static let cellBottom:CGFloat = 0
    static var cellSize:CGSize{
        get{
            return CGSize(width: 139, height: 219)
        }
    }
    static var cellEdgeInsets:UIEdgeInsets{
        get{
            return  UIEdgeInsets(top: Brand_Vertical_CCell.cellTop, left: 0, bottom: Brand_Vertical_CCell.cellBottom, right: 0)
        }
    }
    
    
    //商品名称
    @IBOutlet weak var pdname_Lb: UILabel!
    //店铺进货价
    @IBOutlet weak var shprice_Lb: UILabel!
    //  利润
    @IBOutlet weak var profit_V: UIView!
    @IBOutlet weak var profit_Lb: UILabel!
    /// 显示已售罄
    @IBOutlet weak var sellOut_ImgV: UIImageView!
    @IBOutlet weak var img1_ImgV: UIImageView!
    var item :HpProductModel?{
        didSet{
            if let item = item  {
                self.pdname_Lb.text = item.pdname
                self.img1_ImgV.setUrlImage(item.img1)
                self.profit_Lb.text = item.profit.getFormatStr()
                self.shprice_Lb.text = item.minshprice.getPriceStr()
                if item.stock == 0 {
                    self.sellOut_ImgV.isHidden = false
                }else{
                    self.sellOut_ImgV.isHidden = true
                }
            }
        }
    }

    
    override func awakeFromNib() {
    
        self.pdname_Lb.normal_fontSize(45)
        
    }
}
